package org.wxl.domain;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @author 王学良
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("products")
public class productsEntity {
    /**
     * CREATE TABLE `products` (
     *   `uuid` CHAR(36) NOT NULL COMMENT '商品ID',
     *   `name` VARCHAR(255) NOT NULL COMMENT '商品名称',
     *   `description` TEXT COMMENT '商品描述',
     *    product_avatar VARCHAR(255) comment '产品图片',
     *   `price` DECIMAL(10,2) NOT NULL COMMENT '价格',
     *   `stock` INT UNSIGNED NOT NULL DEFAULT 0 COMMENT '库存',
     *   `category_id` CHAR(36) NOT NULL COMMENT '分类ID',
     *   `supplier_id` CHAR(36) NOT NULL COMMENT '供应商ID',
     *   `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '上架时间',
     *   `status` VARCHAR(4) DEFAULT '1' COMMENT '状态（0:下架，1:上架）',
     *   PRIMARY KEY (`uuid`)
     * ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='商品表';
     */

    @Schema(description = "商品ID")
    @TableId(value = "uuid")
    private String uuid;

    @Schema(description = "商品名称")
    private String name;

    @Schema(description = "商品描述")
    private String description;

    @Schema(description = "商品图片")
    private String productAvatar;

    @Schema(description = "价格")
    private Double price;

    @Schema(description = "库存")
    private Integer stock;

    @Schema(description = "分类ID")
    private String categoryId;

    @Schema(description = "供应商ID")
    private String supplierId;

    @Schema(description = "上架时间")
    private LocalDateTime createdAt;

    @Schema(description = "状态（0:下架，1:上架）")
    private String status;

}
